﻿//These tests are needed to ensure the correct operation of an interpreter.
//The code presented here was borrowed from Daniel B Cristofani's documents
//available at his site: http://www.hevanet.com/cristofd/brainfuck/tests.b.

namespace DimOS.Brainfuck
{
    public static class Tests
    {
        //Checks if the buffer is big enough to work with all normal programs
        //Warning: will take an eternity to finish, as it goes to cell 30000
        public const string BufferLength = @"++++[>++++++<-]>[>+++++>+++++++<
        <-]>>++++<[[>[[>>+<<-]<]>>>-]>-[>+>+<<-]>]+++++[>+++++++<<++>-]>.<<.";

        //Checks the interpreter for the syntax exceptions, should output an H
        public const string Syntax = "[]++++++++++[>>+>+>++++++[<<+<+++>>>-]"
        + "<<<<-]\"A*$\";?@[#>>+<<]>[>>]<<<<[>++<[-]]>.";

        //Pseudo-random byte generator which uses Rule 30 cellular automaton
        public const string RandomNumber = @">>>++[<++++++++[<[<++>-]>>[>>]+>
        >+[-[->>+<<<[<[<<]<+>]>[>[>>]]]<[>>[-]]>[>[-<<]>[<+<]]+<<]<[>+<-]>>-]
        <.[-]>>]";

        //The famous 99 Bottles of Beer chant(well, somehow it just works) \o/
        public const string Beer99 = @">+++++++++[<+++++++++++>-]<[>[-]>[-]<<
        [>+>+<<-]>>[<<+>>-]>>>[-]<<<+++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++
        ++++++++>>>+<-]<<-<-]+++++++++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-
        ]<<<[>>+>+<<<-]>>>[<<<+>>>-]>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<++++++++
        [<++++++<++++++>>-]>>>[>+>+<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>
        [-]++++[<++++++++>-]<.>++++[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+
        ++++..--------.-------.>>[>>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++
        .>>>>-]<<<<[-]>++++[<++++++++>-]<.>+++++++++[<+++++++++>-]<--.-------
        --.>+++++++[<---------->-]<.>++++++[<+++++++++++>-]<.+++..+++++++++++
        ++.>++++++++[<---------->-]<--.>+++++++++[<+++++++++>-]<--.-.>+++++++
        +[<---------->-]<++.>++++++++[<++++++++++>-]<++++.------------.---.>+
        ++++++[<---------->-]<+.>++++++++[<+++++++++++>-]<-.>++[<----------->
        -]<.+++++++++++..>+++++++++[<---------->-]<-----.---.>>>[>+>+<<-]>>[<
        <+>>-]<[<<<<<.>>>>>-]<<<<<<.>>>++++[<++++++>-]<--.>++++[<++++++++>-]<
        ++.>+++++[<+++++++++>-]<.><+++++..--------.-------.>>[>>+>+<<<-]>>>[<
        <<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<++++++++>-]<.>++++++
        +++[<+++++++++>-]<--.---------.>+++++++[<---------->-]<.>++++++[<++++
        +++++++>-]<.+++..+++++++++++++.>++++++++++[<---------->-]<-.---.>++++
        +++[<++++++++++>-]<++++.+++++++++++++.++++++++++.------.>+++++++[<---
        ------->-]<+.>++++++++[<++++++++++>-]<-.-.---------.>+++++++[<-------
        --->-]<+.>+++++++[<++++++++++>-]<--.+++++++++++.++++++++.---------.>+
        +++++++[<---------->-]<++.>+++++[<+++++++++++++>-]<.+++++++++++++.---
        -------.>+++++++[<---------->-]<++.>++++++++[<++++++++++>-]<.>+++[<--
        --->-]<.>+++[<++++++>-]<..>+++++++++[<--------->-]<--.>+++++++[<+++++
        +++++>-]<+++.+++++++++++.>++++++++[<----------->-]<++++.>+++++[<+++++
        ++++++++>-]<.>+++[<++++++>-]<-.---.++++++.-------.----------.>+++++++
        +[<----------->-]<+.---.[-]<<<->[-]>[-]<<[>+>+<<-]>>[<<+>>-]>>>[-]<<<
        +++++++++<[>>>+<<[>+>[-]<<-]>[<+>-]>[<<++++++++++>>>+<-]<<-<-]+++++++
        ++>[<->-]>>+>[<[-]<<+>>>-]>[-]+<<[>+>-<<-]<<<[>>+>+<<<-]>>>[<<<+>>>-]
        <>>[<+>-]<<-[>[-]<[-]]>>+<[>[-]<-]<++++++++[<++++++<++++++>>-]>>>[>+>
        +<<-]>>[<<+>>-]<[<<<<<.>>>>>-]<<<<<<.>>[-]>[-]++++[<++++++++>-]<.>+++
        +[<++++++++>-]<++.>+++++[<+++++++++>-]<.><+++++..--------.-------.>>[
        >>+>+<<<-]>>>[<<<+>>>-]<[<<<<++++++++++++++.>>>>-]<<<<[-]>++++[<+++++
        +++>-]<.>+++++++++[<+++++++++>-]<--.---------.>+++++++[<---------->-]
        <.>++++++[<+++++++++++>-]<.+++..+++++++++++++.>++++++++[<---------->-
        ]<--.>+++++++++[<+++++++++>-]<--.-.>++++++++[<---------->-]<++.>+++++
        +++[<++++++++++>-]<++++.------------.---.>+++++++[<---------->-]<+.>+
        +++++++[<+++++++++++>-]<-.>++[<----------->-]<.+++++++++++..>++++++++
        +[<---------->-]<-----.---.+++.---.[-]<<<]";
    }
}
